(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/moneyPrefab.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, 'e3a97RfHxVCtJXAlBvQ9W26', 'moneyPrefab', __filename);
// Script/moneyPrefab.js

"use strict";

cc.Class({
    extends: cc.Component,

    properties: {
        headSprite: cc.Node,
        nameLabel: cc.Label,
        descLabel: cc.Label,
        moneyMessageDic: ""

    },

    withdrawClick: function withdrawClick() {

        if (this.moneyMessageDic["money_value"] < this.moneyMessageDic["give_money"]) {

            console.log("提现不足");
            var mainNode = cc.find("Canvas/MainCamera/moneyFaileAlertView");
            mainNode.active = true;

            var nameLabelNode = cc.find("Canvas/MainCamera/moneyFaileAlertView/endSprites/nameLabel");
            nameLabelNode.getComponent(cc.Label).string = this.moneyMessageDic["tip_msg"];
        } else {

            var phoneNode = cc.find("Canvas/MainCamera/moneyPhoneView");
            phoneNode.active = true;
        }
    },

    // onLoad () {},

    start: function start() {},
    init: function init(moneyDic) {

        this.moneyMessageDic = moneyDic;
        this.nameLabel.getComponent(cc.Label).string = moneyDic["name"];
        this.descLabel.getComponent(cc.Label).string = moneyDic["des"];
        var that = this;
        cc.loader.load({ url: moneyDic["thumbnail"], type: 'png' }, function (err, img) {
            var mylogo = new cc.SpriteFrame(img);
            that.headSprite.getComponent(cc.Sprite).spriteFrame = mylogo;
            that.headSprite.width = 106;
            that.headSprite.height = 106;
        });
    }
    // update (dt) {},

});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=moneyPrefab.js.map
        